<template>
	<view class="">
		<view class="container">
			<u-swiper :list="list1" @click="click" class="swiper" style="border-radius: 22px;" height="350" indicatorActiveColor="#389bff"></u-swiper>
		</view>
		<view class="container" style="display: flex;">
			<u-button type="default" @click="goDetail" style="width:100px">详情</u-button>
			<u-button type="default" @click="creat" style="width:100px">创建比赛</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [
				  "/static/image/jordan.jpeg",
				  "/static/image/jordan2.jpeg",
				  "/static/image/kobe.jpg",
				],
			}
		},
		methods: {
			click(index) {
				console.log(index);
				uni.showToast({
					title: JSON.stringify(index),
					position: "center"
				});
			},
			goDetail() {
				uni.navigateTo({
					url: '/pages/detail/detail'
				})
			},
			creat() {
				uni.navigateTo({
					url: '/pages/creat/creat'
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		display: flex;
		justify-content: center;
	}
	.swiper {
		width: 90%;
		margin: 50rpx 0;
		border: 1px solid #000;
	}
</style>